//分配缩小
//let x : string | number
let x = Math.random() < 0.5 ? 10 : 'hello'

//let x : number
x = 1
console.log(x);

// let x = string
x = "goodbye!"

//let x: boolean
x = true
